package cn.yitun.chat.yitunserverimbase.dao.group;

import cn.yitun.chat.yitunservercommonlib.crud.yitun.CrudDao;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.group.GroupChatContentDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.po.group.GroupChatContentInfo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.group.GroupChatContentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 聊天内容表
 * @author chenyitun
 * @email chenyitun@163.com
 * @date 2020-05-27 14:42:53
 */
@Mapper
public interface GroupChatContentDao extends CrudDao<GroupChatContentDto, GroupChatContentInfo, GroupChatContentVo> {

	int absDel(Long id);

	int batchAbsDel(Long[] ids);

	/**
	 * 获取聊天所有内容
	 * @param text
	 * @param userNickname
	 * @return
	 */
	List<GroupChatContentVo> queryGroupChatContentList(@Param("text") String text ,@Param("userNickname") String userNickname);

	/**
	 *
	 * @param groupId
	 * @param startMessageId
	 * @return
	 */
    GroupChatContentVo getVOByMessageId(@Param("groupId") Long groupId, @Param("messageId") Long startMessageId);

	/**
	 * 获取群聊历史记录
	 */
    List<GroupChatContentVo> selGroupChatContentList(@Param("groupId") Long groupId,
													 @Param("outId") Long outId,
													 @Param("outMessageId") Long outMessageId,
													 @Param("latest") boolean latest,
													 @Param("timestamp") Long timeStamp,
													 @Param("searchNum") Integer searchNum);
}
